package com.synjones.wschool.face.constant;

import com.synjones.wschool.common.util.CheckUtil;

/**
 * 用户来源枚举类
 *
 * @author zhuchangbin
 * @date 2017/11/7
 */
public enum UserSourceEnum {
    /**
     * 教师
     */
    TEACHER(1),
    /**
     * 监护人
     */
    GUARDIAN(2),
    /**
     * 学生
     */
    STUDENT(3),
    /**
     * 操作员
     */
    OPERATOR(4);


    private Integer userSourceId;

    UserSourceEnum(Integer userSourceId) {
        this.userSourceId = userSourceId;
    }

    public Integer getUserSourceId() {
        return userSourceId;
    }


    public static boolean containsType(Integer userSourceId) {
        UserSourceEnum[] values = UserSourceEnum.values();
        for (UserSourceEnum value : values) {
            if (CheckUtil.equals(value.getUserSourceId(), userSourceId)) {
                return true;
            }
        }
        return false;
    }
}
